import httpFetch from 'share/httpFetch'
import errorMessage from "share/errorMessage";

export default {

  getColumns(tableName) {
    return httpFetch.get('/api/tableColumn', { tableName })
      .catch(e => {
        errorMessage(e.response);
        throw e;
      })
  },

  saveColumns(tableName, columns) {
    return httpFetch.post(`/api/tableColumn?tableName=${tableName}`, columns)
      .catch(e => {
        errorMessage(e.response);
        throw e;
      })
  }

}
